Skip to content

Add Hegel property tests for OnPair, EliasFano, Unary, and ZigZag - #12334

Open
lwwmanning wants to merge 4 commits into
developfrom
wm/hegel-onpair-eliasfano-zigzag
Open

lwwmanning wants to merge 4 commits into
developfrom
wm/hegel-onpair-eliasfano-zigzag

Conversation

@lwwmanning

@lwwmanning lwwmanning commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Wires OnPair, EliasFano (both Primitive and Unary upper representations), Unary, and ZigZag into the shared Hegel encoding harness so serde, scalar probing, comparisons, and chained slice/take/filter/mask ops are checked differentially across generated inputs. Also adds OnPair Hegel coverage for dense repeated Dict takes and Like pushdown across escaped metacharacters and long ContainsScan substrings, strips Instant timing and eprintln! output from the 100k-row smoke test in encodings/onpair/tests/big_data.rs, and removes the unused num-traits dependency from vortex-zigzag.

Authored with AI assistance (Antigravity / Gemini).

Wires OnPair, EliasFano (both Primitive and Unary upper representations), Unary, and ZigZag into the shared Hegel encoding harness so serde, scalar probing, comparisons, and chained slice/take/filter/mask ops are checked differentially across generated inputs. Also adds OnPair Hegel coverage for dense repeated Dict takes and Like pushdown across escaped metacharacters and 254-byte state boundaries, replaces the 100k-row Instant::now() smoke test in encodings/onpair/tests/big_data.rs with a compact corpus roundtrip test, and removes the unused num-traits dependency from vortex-zigzag.

Authored with AI assistance (Antigravity / Gemini).

Signed-off-by: Will Manning <will@willmanning.io>
@lwwmanning lwwmanning added the changelog/skip Do not list PR in the changelog label Nov 29, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T18:59:49.952890Z 06b8535 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@vortex-roborev-bot

vortex-roborev-bot Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

roborev: Combined Review (1978633)

Verdict: No issues found.


Reviewers: claude-code | Synthesis: claude-code, 0s | Total: 53s, cost partial ~$0.36

vortex-roborev-bot[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@lwwmanning lwwmanning left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by Claude Opus 5.5 on Will's behalf.

  • encodings/zigzag/src/compress.rs lines 266 to 270: as roborev and Codex noted, assert_arrays_eq! clones its left side. The encoded buffer stays shared, so the in-place decode from #12048 never runs. The block repeats the out-of-place check that the harness already does. Delete it, or decode the encoded array by value and compare the result.
  • encodings/onpair/src/tests.rs line 914: the new corpus test does not replace big_data.rs. The old test ran 100,000 rows with 32-bit random ids over 13 templates, so the dictionary saw many distinct tokens. The new test runs 2,048 rows with 256 ids over 6 templates. codes_buffer_has_little_spare_capacity still compresses 8,192 high-entropy rows, so the main loss is scale.
  • The new test's roundtrip and equality checks repeat test_onpair_hegel_encoding_harness (line 951), which runs with compare on. Keep big_data.rs and delete only its Instant timing and eprintln! output. Or delete both tests, and say in the description that the large-corpus coverage is gone.

… test

Decode owned_encoded by value before comparing in test_zigzag_hegel_encoding_harness
so the uniquely owned in-place decode path is exercised. Restore the 100k-row
OnPair big_data smoke test without Instant timing or eprintln output and remove
the redundant smaller corpus test.

Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Addressed the review findings in fc5914583:

  • encodings/zigzag/src/compress.rs: owned_encoded is now consumed via .execute::<PrimitiveArray>(&mut ctx) before assert_arrays_eq! so the uniquely owned in-place decode path (Speed up ZigZag encode and decode of shared buffers #12048) runs.
  • encodings/onpair/tests/big_data.rs & encodings/onpair/src/tests.rs: restored the 100k-row big_data.rs test with Instant timing and eprintln! output removed, and deleted the redundant 2,048-row corpus test.

devin-ai-integration[bot]

This comment was marked as resolved.

@lwwmanning lwwmanning left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by Claude Opus 5.5 on Will's behalf.

Commit fc59145 resolves both points from my earlier review. The ZigZag owned case now decodes by value, so it can reach the in-place path from #12048. big_data.rs is back at 100,000 rows without its timing output, and the smaller duplicate corpus test is gone.

…tions

Assert buffer pointer reuse on owned ZigZag decode, exercise OnPair's
>= 1024-row TakeExecute specialization in test_onpair_dict_dense_repeated_takes,
and assert OnPair LikeKernel pushdown for supported patterns in
test_onpair_like_hegel_differential.

Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>

@lwwmanning lwwmanning left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by Claude Opus 5.5 on Will's behalf.

I checked ed4fe5f. The ZigZag pointer check and the larger OnPair take draws look right.

One point in encodings/onpair/src/compute/like.rs, lines 476 to 491. The new Contains arms assume a 254-byte limit that the kernel does not have. The kernel uses ContainsScan, and in onpair 0.4.1 its limit is 65,535 bytes. The 254-byte limit belongs to ContainsDfa, which the kernel does not call.

A trained dictionary has a token for every byte, so as far as I can tell every Contains pattern that these generators draw pushes down. The pattern_branch == 2 && include_long guard only makes the check narrower. Please merge the three Contains arms into the arm that expects pushdown, and correct the comment about the 254-byte ContainsScan limit at line 409.

ContainsScan supports up to 65,535 bytes and a trained OnPair dictionary
covers every byte, so merge the Contains arms into the arm expecting
pushdown and fix the comments referencing a 254-byte limit.

Signed-off-by: Will Manning <will@spiraldb.com>
Co-Authored-By: Will Manning <will@spiraldb.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Fixed in 197863398: merged all Pattern::parse Some(_) arms (including Contains) into the arm asserting LikeKernel pushdown and updated the comments referencing a 254-byte limit.

@lwwmanning lwwmanning left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by Claude Opus 5.5 on Will's behalf.

Commit 1978633 resolves my last review. The property test now requires pushdown for every parsed pattern, the three Contains arms are gone, and the comments no longer mention a 254-byte limit. It also checks that the kernel declines case-insensitive and null patterns, which matches the early returns in the kernel.

@codspeed

codspeed Bot commented Nov 29, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 14.43%

Warning

vortex-data has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed.

2 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 1 improved benchmark
✅ 2176 untouched benchmarks
⏩ 164 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Walltime dict_canonicalize_gt_u8_neon[1000000] 29 µs 25.3 µs +14.43%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing wm/hegel-onpair-eliasfano-zigzag (1978633) with develop (4525dfa)

Open in CodSpeed

Footnotes

  1. 164 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/skip Do not list PR in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant